package com.cchc.k8s.config;

/**
 * file：K8sException.java
 * description:自定义异常
 * date: 2021-09-18 09:04
 * author: wenrui
 * version: 1.0
 */
public class K8sException extends RuntimeException {
    private String code;
    private String msg;

    public K8sException() {
        this(ResultCode.FAILED);
    }

    public K8sException(ResultCode failed) {
        this.code = failed.getCode();
        this.msg = failed.getMsg();
    }

    public K8sException(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }

    public void setCode(final String code) {
        this.code = code;
    }

    public void setMsg(final String msg) {
        this.msg = msg;
    }

    public String toString() {
        return "OpException(code=" + this.getCode() + ", msg=" + this.getMsg() + ")";
    }
}
